<template>
    <div class="container">
        <div class="screen" ref="screen">
            <div class="top">
                <Top></Top>
            </div>
            <div class="bottom">
                <div class="left">
                    <Tourist></Tourist>
                    <Gender></Gender>
                    <Age></Age>
                </div>
                <div class="center"></div>
                <div class="right"></div>

            </div>
        </div>
    </div>
</template>

<script setup lang="ts">
import { onMounted, ref } from 'vue';
import Top from './components/Top.vue'
import Tourist from './components/tourist.vue'
import Gender from './components/gender.vue'
import Age from './components/Age.vue'

const screen = ref()
onMounted(() => {
    screen.value.style.transform = `scale(${getScale()}) translate(-50%,-50%)`

})
const getScale = (w = 1920, h = 1080) => {
    let ww = window.innerWidth / w
    let wh = window.innerHeight / h
    return ww < wh ? ww : wh
}
window.onresize = () => {
    screen.value.style.transform = `scale(${getScale()}) translate(-50%,-50%)`
}
</script>

<style lang="scss" scoped>
.container {
    width: 100vw;
    height: 100vh;
    background: url(./images/bg.png);
    background-repeat: no-repeat;
    background-size: cover;

    .screen {
        position: fixed;
        width: 1920px;
        height: 1080px;
        left: 50%;
        top: 50%;
        transform-origin: left top;
    }

    .top {
        width: 100%;
        height: 40px;
    }

    .bottom {
        display: flex;
        height: calc(100vh - 40px);

        .left {
            flex: 1;
        }

        .center {
            flex: 2;
        }

        .right {
            flex: 1;
        }
    }
}
</style>